<template>
  <el-row class="panel-top-label">
    <el-col
      v-for="(item, index) in tabs"
      :key="index"
      :span="item.span"
      :style="{ 'text-align': `${item.align}` }"
      class="operate-Label-item"
    >
      <el-checkbox v-model="checked" v-if="item.select" @change="changeSelect" />
      <span class="ml-10">{{ item.label }}</span>
    </el-col>
  </el-row>
</template>

<script>
import { mapMutations, mapState } from 'vuex'
export default {
  name: 'OrderItemTabs',
  components: {},
  props: {
    tabs: {
      type: Array,
      default: () => {
        return []
      }
    }
  },
  data() {
    return {}
  },
  computed: {
    ...mapState('order', ['checkedAll']),
    checked: {
      get() {
        return this.checkedAll
      },
      set(val) {
        return val
      }
    }
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {
    ...mapMutations('order', ['SELECT_ALL_CHANGE', 'SELECT_CHECKED_ALL']),
    changeSelect(val) {
      this.SELECT_ALL_CHANGE({ key: 'orderList', checked: val })
    }
  }
}
</script>

<style lang="scss" scoped>
.panel-top-label {
  height: 40px;
  line-height: 40px;
  font-size: 14px;
  padding: 0 20px;
  background-color: $hw-bg-color-grey;
  .operate-Label-item {
    font-weight: bold;
  }
}
</style>
